#!/usr/bin/python
#+------------------------------------------------------------------------------
#|
#| FILENAME: cairolib_test.py
#|
#| PROJECT: Cairo Libraries
#|
#| FILE DESCRIPTION:
#|    This is a test script to verify that the python library is working
#|    correctly.
#|
#+------------------------------------------------------------------------------
#|
#| Cairolib is a series of extensions, examples, and libraries for the
#| Cairo graphics package (see http://www.cairographics.org).
#| 
#| Copyright (C) 2006  Bradford Elliott
#|
#| This library is free software; you can redistribute it and/or
#| modify it under the terms of the GNU Lesser General Public
#| License as published by the Free Software Foundation; either
#| version 2.1 of the License, or (at your option) any later version.
#| 
#| This library is distributed in the hope that it will be useful,
#| but WITHOUT ANY WARRANTY; without even the implied warranty of
#| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#| Lesser General Public License for more details.
#| 
#| You should have received a copy of the GNU Lesser General Public
#| License along with this library; if not, write to the Free Software
#| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
#| 
#+------------------------------------------------------------------------------
import sys
sys.path.append(".")

from cairolib import cairolib_t

cairo = cairolib_t(800, 600)

# Create a red rectangle
cairo.rectangle(10, 10, 40, 40)
cairo.set_source_rgb(1.0, 0, 0)
cairo.fill()

# Now output it to a PNG 80x60
cairo.write_to_png("test.png", 80, 60)

